package com.fenxiangle.yueding.feature.focus.model;

import com.fenxiangle.yueding.entity.bo.FoucsListBo;
import com.fenxiangle.yueding.entity.bo.PageBo;
import com.fenxiangle.yueding.feature.focus.contract.FocusContract;
import com.fenxiangle.yueding.feature.focus.dependencies.order.DaggerFocusModelComponent;
import com.fenxiangle.yueding.framework.api.ApiLib;
import com.fenxiangle.yueding.framework.api.HomeApi;
import com.suozhang.framework.component.http.RxDataProcessFactory;
import java.util.List;

import javax.inject.Inject;

import io.reactivex.Observable;

public class FocusModel implements FocusContract.Model {

    @Inject
    HomeApi api;


    @Inject
    public FocusModel() {
        DaggerFocusModelComponent.builder().apiComponent(ApiLib.apiComponent()).build().inject(this);
    }


    @Override
    public Observable<List<FoucsListBo>> getOrderList(PageBo pageBo) {
        return api.getFoucsList(pageBo).compose(RxDataProcessFactory.dataPrepAndIoToMainTransformer());
    }
}
